﻿//Write an expression that extracts from a given integer i 
//the value of a given bit number b. Example: i=5; b=2 -> value=1.

using System;

namespace BitNumberValue
{
    class Value
    {
        static void Main()
        {
            Console.Write("Please enter the number i: ");
            int i = int.Parse(Console.ReadLine());
            Console.Write("Please enter the position b: ");
            int b = int.Parse(Console.ReadLine());

            int value = (i >> b & 1);
            Console.WriteLine(value);
        }
    }
}
